<template>
  <h2>今年{{age}}岁</h2>
  <h2>十年后{{newAge}}岁</h2>
  十年后<input type="text" v-model="newAge"/>
  <button @click="age++">点击增加1岁</button>
</template>

<script>
import {computed , ref} from 'vue'
export default {
name:'App',
setup(){
  const age =ref(18)

const newAge =computed({
  get: ()=>{
    return age.value +10
  },
  ste:val=>{
    age.value = val-10
  }
})

  return {age ,newAge}
}
}
</script>

<style>

</style>